
package backs;

import db.NWDB;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;

public class ProductModifyFinish {
    
    private String state;
    private String id;
    
    public ProductModifyFinish() {
    }
    
    public String execute() throws Exception {
        
        System.out.println("id = " + id + "\nstate = " + state);
        NWDB db = new NWDB();
        db.updateStateInBack(id, state);
        db.dbClose();
        
        HttpServletRequest request=ServletActionContext.getRequest(); 
        request.setAttribute("state", state);
        request.setAttribute("id", id);
        return "success";
    }

    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }

    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    
}
